<template>
	<div class="right tr">
		<strong class="f24">{{ timeStr }}</strong>
		<p>
			<span class="text-gray">当前时间：</span>
			<span>{{ nowDate }}</span>
		</p>
	</div>
</template>

<script setup lang="ts">
import { formateDate } from '@/utils/util'
import { useDateFormat } from '@vueuse/core'

const nowDate = formateDate()
const timeStr:any = ref('')
const date = new Date()

timeStr.value = `${date.getHours()}:${date.getMinutes()}`
let timer = null

timer = setInterval(() => {
	const date = new Date()
  timeStr.value =useDateFormat(date, 'HH:mm').value
}, 60000)

onUnmounted(() => {
	timer = null
	clearInterval(timer)
})
</script>

<style scoped></style>
